    <style type="text/css">
    v\:* {
      behavior:url(#default#VML);
    }
    </style>
    <style type="text/css">
    div.children_wrapper
    {
    	padding: 0px 0px 0px 30px;
    	
    }
    </style>
     <!--<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA0Qhd3w3zhgZ-USc3ftv8UBR5ReOozKCrnfIoZl1Pq8mrg7k2bBSFblMKAwaf8o8xGteCzIG6_lkqqw" type="text/javascript"></script>
  	 
    <div id="map" style="width: 600px; height: 400px;"></div>
	-->

<script src="/public/library/hvn/captcha.redraw.js" type="text/javascript"></script>
<script src="/public/library/hvn/place.js" type="text/javascript"></script>

<script language="Javascript">

var mode = '<?= $this->viewParams['mode']?>';

$(function() {
    getAddress(mode);
    getCategoryType(mode);
});

</script>
<div class="box white_bg" style="background-color:#ffffff">
<div class="successMessage"><?if(isset($this->viewParams['successMessage'])):?><?=$this->viewParams['successMessage']?><?endif?></div>
<div class="errorMessage"><?if(isset($this->viewParams['errorMessage'])) :?><?=$this->viewParams['errorMessage']?><?endif?></div>

<form id="newPlace" accept-charset="UTF-8" action="<?= $this->escape($this->viewParams['form']->getAction()) ?>"
      method="<?= $this->escape($this->viewParams['form']->getMethod()) ?>">

<?if($this->viewParams['mode'] === 'edit') :?>
<?else :?>
	<h1><b> <?=t(795) ?>:</b></h1>
	<br/>
<?endif?>

<fieldset class="expansible" ><legend><span><?=t(794) ?></span></legend>

	<table>
        <tr>
            <td><?=t(776) ?>:</td>
            <td><?= $this->viewParams['form']->name ?> 
                ( language:  <?= $this->viewParams['form']->language ?> )
            </td>
        </tr>
        <tr>
            <td><?=t(793) ?>:</td>
            <td><?= $this->viewParams['form']->other_name ?></td>
        </tr>
        <tr>

    	<tr>
			<td> <?=t(14) ?>:</td>
			<td><?= $this->viewParams['form']->rtype ?> &nbsp;&nbsp;&nbsp;
			</td>
		</tr>
		<tr ><td></td><td id="sub-type"> </td></tr>
	</table>
</fieldset>


<fieldset class="expansible"><legend><span><?=t(777) ?></span></legend>
	<table>
			<td><?=t(792) ?>:</td>
			<td><?= $this->viewParams['form']->city_id ?></td>
		</tr>
		<tr id="district">
			<td><?=t(771) ?>:</td>
			<td><?= $this->viewParams['form']->district_id ?></td>
		</tr>
		<tr id="village">
			<td><?=t(789) ?>:</td>
			<td><?= $this->viewParams['form']->village_id ?></td>
		</tr>
		<tr>
			<td><?=t(790) ?>:</td>
			<td><?= $this->viewParams['form']->address5 ?></td>
		</tr>
		<tr>
			<td><?=t(791) ?>:</td>
			<td><?= $this->viewParams['form']->address6 ?></td>
		</tr>
		<tr>
			<td><?=t(781) ?>:</td>
			<td><?= $this->viewParams['form']->address7 ?></td>
		</tr>
		<tr>
			<td><?=t(783) ?>:</td>
			<td><?= $this->viewParams['form']->address8 ?></td>
		</tr>
		<tr>
			<td><?=t(788) ?>:</td>
			<td><?= $this->viewParams['form']->address9 ?></td>
		</tr>
	</table>	
</fieldset>

<?if(!empty($this->viewParams['form']->status)) :?>
    <?=t(2) ?>:<?= $this->viewParams['form']->status ?>
<?endif?>

<?if(!empty($this->viewParams['form']->captcha_newplace)) :?>	
	<div> 
	<?=$this->viewParams['form']->captcha_newplace ?>
	<a href="javascript:void()" class="redraw"> <?=t(22) ?> </a>
	</div>
<?endif?>

<br/>
<div style="text:align:middle">
<?=$this->viewParams['form']->submit ?>
</div>

	<?//die();?>
<?if($this->viewParams['mode'] === 'edit' || $this->viewParams['mode'] === 'new') :?>
	<input type="hidden" name="id" value="<?if(isset($this->viewParams['id'])):?><?=$this->viewParams['id']; ?><?endif?>" />
	
	<script type="text/javascript">
		$(function() {
			<?if(isset($this->viewParams['rtype'])) :?>
				rtypeVal = <?=$this->viewParams['rtype'];?>;
				if($("select#rtype").val() != 0)
				{
					$("select#rtype").val(rtypeVal);
					$("select#rtype").trigger("change");
				}
			<?endif?>
			
		});
		
		function populate_category_checkboxes()
		{
			<?if(!empty($this->viewParams['type'])):?>
			<?foreach ($this->viewParams['type'] as $t) :?>
				$("input:checkbox[name=type[]]").filter("[value=<?=$t?>]").trigger("click");

			    $(".parent_category_checkbox").each( function() {
                    var checked_status = this.checked;
                    if (!checked_status)
                    {
						$(this).siblings("div.children_wrapper").hide();
                 	}
                 	else
                 		$(this).siblings("div.children_wrapper").show();
        		}); 
			<?endforeach?>
			<?endif?>
		}
	</script>
<?endif?>

<?= $this->viewParams['form']->longitude?>
<?= $this->viewParams['form']->latitude?>
</form>
</div>
